package com.zlm.app.emp.controller;

import com.zlm.common.base.BaseController;
import com.zlm.common.dto.JsonResultDto;
import com.zlm.common.enums.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/enum")
public class EnumController extends BaseController {
	
	/**
	 * 获取企业规模
	 * @return
	 */
	@GetMapping("/queryOrgScale")
	public JsonResultDto getCompanyScaleEnum(){
		try {
			return success(CompanyScaleEnum.getCompanyScale());
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("getCompanyScaleEnum error", e.getMessage());
			return fail(e.getMessage());
		}
	}
	
	/**
	 * 获取企业性质
	 * @return
	 */
	@GetMapping("/queryOrgNature")
	public JsonResultDto getCompanyNatureEnum(){
		try {
			return success(CompanyNatureEnum.getCompanyNature());
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("getCompanyNatureEnum error", e.getMessage());
			return fail(e.getMessage());
		}
	}

	/**
	 * 获取职位类型
	 * @return
	 */
	@GetMapping("/getQuickEntry")
	public JsonResultDto getQuickEntry() {
		try {
			return success(QuickEntryEnum.getQuickEntryEnum());
		} catch (Exception e) {
			e.printStackTrace();
			return fail(e.getMessage());
		}
	}
	
	/**
	 * 工作性质
	 * @return
	 */
	@GetMapping("/queryJobNature")
	public JsonResultDto getJobNature(){
		try {
			return success(JobNatureEnum.getJobNature());
		} catch (Exception e) {
			e.printStackTrace();
			return fail(e.getMessage());
		}
	}

	/**
	 * 工作类型
	 * @return
	 */
	@GetMapping("/getWorkType")
	public JsonResultDto getWorkType(){
		try {
			return success(WorkTypeEnum.getWorkType());
		} catch (Exception e) {
			e.printStackTrace();
			return fail(e.getMessage());
		}
	}
	
	/**
	 * 获取薪资范围
	 * @return
	 */
	@GetMapping("/querySalary")
	public JsonResultDto getSalary(){
		try {
			return success(SalaryRangeEnum.getList());
		} catch (Exception e) {
			e.printStackTrace();
			return fail(e.getMessage());
		}
	}
	
	/**
	 * 获取求职状态
	 * @return
	 */
	@GetMapping("/queryJobState")
	public JsonResultDto getJobHuntingStatusEnum(){
		try {
			return success(JobHuntingStatusEnum.getJobStatusEnum());
		} catch (Exception e) {
			e.printStackTrace();
			return fail(e.getMessage());
		}
	}
	
	/**
	 * 学历
	 * @return
	 */
	@GetMapping("/queryEducation")
	public JsonResultDto getEducationEnum(){
		try {
			return success(EducationEnum.getEducation());
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("getEducationEnum error", e.getMessage());
			return fail(e.getMessage());
		}
	}
	
	/**
	 * 婚姻状况
	 * @return
	 */
	@GetMapping("/queryMaritalState")
	public JsonResultDto getMaritalStatusEmum(){
		try {
			return success(MarriedEnum.getMaritalStatus());
		} catch (Exception e) {
			e.printStackTrace();
			return fail(e.getMessage());
		}
	}
	
	/**
	 * 性别
	 * @return
	 */
//	@RequestMapping(value ="/querySex")
//	@ResponseBody
//	@ApiOperation(httpMethod = "GET", value= "获取性别" )
//	public JsonResult getGenderEnum(){
//		try {
//			return succeedResult("操作成功", GenderEnum.getGender());
//		} catch (Exception e) {
//			e.printStackTrace();
//			logger.error("getGenderEnum error", e.getMessage());
//			return failResult(AgencyConstants.CODE_SYSTEM_ERROR, "网络繁忙",null);
//		}
//	}

	/**
	 * 获取所有技能
	 * @return
	 */
	@GetMapping("/queryAllSkills")
	public JsonResultDto queryAllSkills(){
		try {
			return success(SkillsEnum.getSkills());
		} catch (Exception e) {
			e.printStackTrace();
			return fail(e.getMessage());
		}
	}

//	@RequestMapping(value = "/queryOrderStatus")
//	@ResponseBody
//	@ApiOperation(value = "查询订单状态(暂不可用)",httpMethod = "GET")
//	public JsonResult queryOrderStatus(){
//		try {
//			return succeedResult("操作成功", SkillsEnum.getSkills());
//		} catch (Exception e) {
//			e.printStackTrace();
//			logger.error("查询技能 error", e.getMessage());
//			return failResult(AgencyConstants.CODE_SYSTEM_ERROR, "网络繁忙",null);
//		}
//	}


}
